export interface ISeries {
  name: string;
  type: 'line';
  data: number[];
  [key: string]: any;
}
export interface IName {
  name: string;
}
export interface IParam {
  xData: string[];
  series: ISeries[];
  name: string;
  lengend: IName[];
}
export const getOptions = (params: IParam) => {
  return {
    color: [
      '#5EBE75',
      '#4571E0',
      '#4FA0FF',
      '#6735DC',
      '#BE5E8B',
      '#4FB6CC',
      '#2647FF',
      '#B287F7',
      '#8034C8',
      '#885EBE'
    ],
    grid: {
      top: '40px'
      // bottom: '25px',
    },
    tooltip: {
      trigger: 'axis'
    },
    legend: {
      bottom: 10,
      itemGap: 20,
      textStyle: {
        color: '#fff'
      },
      data: params.lengend
    },
    xAxis: {
      type: 'category',
      boundaryGap: false,
      axisLabel: {
        color: '#999'
      },
      splitLine: {
        lineStyle: {
          color: ['#777']
        }
      },
      data: params.xData //['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    },
    yAxis: {
      type: 'value',
      axisLabel: {
        color: '#999'
      },
      splitLine: {
        lineStyle: {
          color: ['#777']
        }
      },
      name: params.name
    },
    series: params.series
  }
}
